﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="Cadastros_Turma_cadastro" Codebehind="Turma_cadastro.aspx.cs" %>
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <script type="text/javascript">
        function GetRadWindow() {
            var oWindow = null;
            if (window.radWindow) oWindow = window.radWindow;
            else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
            return oWindow;
        }

        function Close() {
            GetRadWindow().close();
        }

        function CloseWithArg() {
            var customArg = document.getElementById('ctm_cad_diretiva_id').value;
            GetRadWindow().close(customArg);
        }


        //      função para retornar um vetor de argumentos para pagina de origem
        function returnToParent() {
            //crear argumento para retorno a pagina pai
            var oArg = new Object();
            //obter dados da diretiva
            oArg.diretivaID = document.getElementById('hid_aluno_id').value
            oArg.diretivaDesc = "Descricao";
            alert(oArg.diretivaID);
            return false;
        }

                

    </script>
</head>
<body>
    <form id="form1" runat="server">
    
    <asp:ObjectDataSource ID="ods_Modalidade" runat="server"  
        SelectMethod="_obter_Modalidade" 
        TypeName="Banco.BD_Modalidade" onselecting="ods_Modalidade_Selecting"> 
        <SelectParameters> 
            <asp:Parameter Name="MODALIDADE_ID" Type="String" /> 
            <asp:Parameter Name="MOD_DESCRICAO" Type="String" /> 
            <asp:Parameter Name="MOD_EXCLUIDO" Type="String" />
            <asp:Parameter Name="ORDER_BY_CLAUSE" Type="String" />
        </SelectParameters> 
    </asp:ObjectDataSource>

    <asp:ObjectDataSource ID="ods_Sala" runat="server"  
        SelectMethod="_obter_Sala" 
        TypeName="Banco.BD_Sala" onselecting="ods_Sala_Selecting"> 
        <SelectParameters> 
            <asp:Parameter Name="SALA_ID" Type="String" /> 
            <asp:Parameter Name="SAL_DESCRICAO" Type="String" /> 
            <asp:Parameter Name="SAL_EXCLUIDO" Type="String" />
        </SelectParameters> 
    </asp:ObjectDataSource>

    <asp:ObjectDataSource ID="ods_Turno" runat="server" 
        SelectMethod="_obter_Turno" 
         TypeName="Banco.BD_Turno">
        <SelectParameters>
            <asp:Parameter Name="TURNO_ID" Type="String" />
            <asp:Parameter Name="TUR_DESCRICAO" Type="String" />
            <asp:Parameter Name="TUR_EXLUIDO" Type="String" />
            <asp:Parameter Name="ORDER_BY_CLAUSE" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>

    <asp:ObjectDataSource ID="ods_Nivel" runat="server"  
        SelectMethod="_obter_Nivel" 
        TypeName="Banco.BD_Nivel" onselecting="ods_Nivel_Selecting"> 
        <SelectParameters> 
            <asp:Parameter Name="NIVEL_ID" Type="String" /> 
            <asp:Parameter Name="NIV_DESCRICAO" Type="String" /> 
            <asp:Parameter Name="ST_EXCLUIDO" Type="String" />
            <asp:Parameter Name="ORDER_BY_CLAUSE" Type="String" />
        </SelectParameters> 
    </asp:ObjectDataSource>

    <asp:ObjectDataSource ID="ods_Professor" runat="server"  
        SelectMethod="_obter_Usuario" 
        TypeName="Banco.BD_Usuario" onselecting="ods_Professor_Selecting"> 
        <SelectParameters> 
            <asp:Parameter Name="USUARIO_ID" Type="String" /> 
            <asp:Parameter Name="USUARIO_TIPO_ID" Type="String" />
            <asp:Parameter Name="USU_NOME" Type="String" /> 
            <asp:Parameter Name="USU_LOGIN" Type="String" />
            <asp:Parameter Name="USU_DTINCULSAO" Type="String" />
            <asp:Parameter Name="SOLICITANTE_ID" Type="String" />
            <asp:Parameter Name="USU_PASS" Type="String" />
            <asp:Parameter Name="USU_ALTERASENHA" Type="String" />
            <asp:Parameter Name="USU_EMAIL" Type="String" />
            <asp:Parameter Name="USU_STEXCLUIDO" Type="String" />
            <asp:Parameter Name="ORDER_BY_CLAUSE" Type="String" />
        </SelectParameters> 
    </asp:ObjectDataSource>


    <asp:HiddenField ID="hid_operacao" runat="server" />    
    <asp:HiddenField ID="hid_pessoa_id" runat="server" />

    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>


    <div>        
        <table width="99%" cellpadding="0" cellspacing="0">
            <tr>
                    <td>
                            
                            <div style="float:left; margin-left:5px; width:11%; margin-top:8px;">
                                <asp:Label ID="lbl_turma_id" runat="server" Text="Código" 
                                    Font-Bold="True" Font-Size="X-Small"></asp:Label>        
                                <telerik:RadTextBox ID="turma_id" Runat="server" Font-Size="X-Small" 
                                    Width="97%" 
                                    ReadOnly="true">
                                    <ReadOnlyStyle BackColor="#D6DCDB" />
                                </telerik:RadTextBox>
                            </div>
                            <div style="float:left; margin-left:10px; width:55%">
                                <asp:Label ID="lbl_tur_descricao" runat="server" Text="Descrição" 
                                    Font-Bold="True" Font-Size="X-Small"></asp:Label>
                                <asp:RequiredFieldValidator ID="rfv_tur_descricao" runat="server" ControlToValidate="tur_descricao"
                                    ErrorMessage=" (*)" ForeColor="Red" ValidationGroup="camposObrigatorios"></asp:RequiredFieldValidator>
                                <telerik:RadTextBox ID="tur_descricao" Runat="server" Font-Size="X-Small" 
                                    Width="97%" 
                                    ReadOnly="false" TabIndex="1">
                                    <ReadOnlyStyle BackColor="#D6DCDB" />
                                </telerik:RadTextBox>
                            </div>
                            <div style="float:right; margin-right:5px; width:30%; ">
                                <asp:Label ID="lbl_modalidade_id" runat="server" Text="Modalidade" 
                                    Font-Bold="True" Font-Size="X-Small"></asp:Label>        
                                <asp:RequiredFieldValidator ID="rfv_modalidade_id" runat="server" ControlToValidate="modalidade_id"
                                    ErrorMessage=" (*)" ForeColor="Red" ValidationGroup="camposObrigatorios"></asp:RequiredFieldValidator>
                                <telerik:RadComboBox ID="modalidade_id" runat="server" 
                                                            Font-Size="X-Small" Width="100%" DataTextField="MOD_DESCRICAO" 
                                                            DataValueField="MODALIDADE_ID" Filter="Contains" 
                                                            EmptyMessage="Selecione" MarkFirstMatch="True" 
                                                            EnableLoadOnDemand="True" onitemsrequested="modalidade_id_ItemsRequested" 
                                                            style="margin-bottom: 0px" TabIndex="2">                        
                                            </telerik:RadComboBox>
                            </div>
                            <%--linha--%>
                            <div style="float:left; margin-left:0px; width:100%;" >
                            
                                <div style="float:left; margin-left:5px; width:18%; margin-top:8px;" >
                                    <asp:Label ID="lbl_sala_id" runat="server" Text="Sala" 
                                        Font-Bold="True" Font-Size="X-Small"></asp:Label>                                            
                                    <telerik:RadComboBox ID="sala_id" runat="server" 
                                                                Font-Size="X-Small" Width="100%" DataTextField="SAL_DESCRICAO" 
                                                                DataValueField="SALA_ID" Filter="Contains" 
                                                                EmptyMessage="Selecione" MarkFirstMatch="True" 
                                                                EnableLoadOnDemand="True" onitemsrequested="sala_id_ItemsRequested" 
                                                                style="margin-bottom: 0px" TabIndex="3">                        
                                                </telerik:RadComboBox>
                                </div>                            
                                <div style="float:left; margin-left:10px; width:15%; ">
                                    <asp:Label ID="lbl_turno_id" runat="server" Text="Horário" 
                                        Font-Bold="True" Font-Size="X-Small"></asp:Label>        
                                    <asp:RequiredFieldValidator ID="rfv_turno_id" runat="server" ControlToValidate="turno_id"
                                        ErrorMessage=" (*)" ForeColor="Red" ValidationGroup="camposObrigatorios"></asp:RequiredFieldValidator>
                                    <telerik:RadComboBox ID="turno_id" runat="server" 
                                                                Font-Size="X-Small" Width="100%" DataTextField="TUR_DESCRICAO" 
                                                                DataValueField="TURNO_ID" Filter="Contains" 
                                                                EmptyMessage="Selecione" MarkFirstMatch="True" 
                                                                EnableLoadOnDemand="True" onitemsrequested="turno_id_ItemsRequested" 
                                                                style="margin-bottom: 0px" TabIndex="4">                        
                                                </telerik:RadComboBox>
                                </div>
                                <div style="float:left; margin-left:10px; width:15%; margin-top:8px; ">
                                    <asp:Label ID="lbl_turno_alter_id" runat="server" Text="Horário alternativo" 
                                        Font-Bold="True" Font-Size="X-Small"></asp:Label>                                            
                                    <telerik:RadComboBox ID="turno_alter_id" runat="server" 
                                                                Font-Size="X-Small" Width="100%" DataTextField="TUR_DESCRICAO" 
                                                                DataValueField="TURNO_ID" Filter="Contains" 
                                                                EmptyMessage="Selecione" MarkFirstMatch="True" 
                                                                EnableLoadOnDemand="True" onitemsrequested="turno_alter_id_ItemsRequested" 
                                                                style="margin-bottom: 0px" 
                                        ToolTip="Selecione esta opção quando houver mais de um turno" TabIndex="5">                        
                                                </telerik:RadComboBox>
                                </div>
                                <div style="float:left; margin-left:10px; width:25%;">
                                    <asp:Label ID="lbl_nivel_id" runat="server" Text="Nível" 
                                        Font-Bold="True" Font-Size="X-Small"></asp:Label>        
                                    <asp:RequiredFieldValidator ID="rfv_nivel_id" runat="server" ControlToValidate="nivel_id"
                                        ErrorMessage=" (*)" ForeColor="Red" ValidationGroup="camposObrigatorios"></asp:RequiredFieldValidator>
                                    <telerik:RadComboBox ID="nivel_id" runat="server" 
                                                                Font-Size="X-Small" Width="100%" DataTextField="NIV_DESCRICAO" 
                                                                DataValueField="NIVEL_ID" Filter="Contains" 
                                                                EmptyMessage="Selecione" MarkFirstMatch="True" 
                                                                EnableLoadOnDemand="True" onitemsrequested="nivel_id_ItemsRequested" 
                                                                style="margin-bottom: 0px" TabIndex="6">                        
                                                </telerik:RadComboBox>
                                </div>
                                <div style="float:right; margin-right:5px; width:20%; ">
                                    <asp:Label ID="Label4" runat="server" Text="Modalidade cobrança" 
                                        Font-Bold="True" Font-Size="X-Small"></asp:Label>        
                                    <asp:RequiredFieldValidator ID="rfv_tur_modalidacobranca" runat="server" ControlToValidate="modalidade_id"
                                        ErrorMessage=" (*)" ForeColor="Red" ValidationGroup="camposObrigatorios"></asp:RequiredFieldValidator>
                                    <telerik:RadComboBox ID="tur_modalidacobranca" runat="server" 
                                                    Font-Size="X-Small" Width="100%" Filter="Contains" 
                                                    EmptyMessage="Selecione" MarkFirstMatch="True" 
                                                    EnableLoadOnDemand="True" 
                                                    style="margin-bottom: 0px" AutoPostBack="True" TabIndex="7">
                                        <Items>
                                            <telerik:RadComboBoxItem runat="server" />
                                            <telerik:RadComboBoxItem runat="server" Text="AULA" 
                                                Value="A" Font-Size="X-Small" />
                                            <telerik:RadComboBoxItem runat="server" Text="DIA" 
                                                Value="D" Font-Size="X-Small" />
                                            <telerik:RadComboBoxItem runat="server" Text="SEMANA" 
                                                Value="S" Font-Size="X-Small" />                            
                                            <telerik:RadComboBoxItem runat="server" Text="MES" 
                                                Value="M" Font-Size="X-Small" />
                                            <telerik:RadComboBoxItem runat="server" Text="SEMESTRE" 
                                                Value="E" Font-Size="X-Small" />
                                            <telerik:RadComboBoxItem runat="server" Text="ANUAL" 
                                                Value="N" Font-Size="X-Small" />
                                        </Items>
                                    </telerik:RadComboBox>  
                                </div>
                            </div>
                            <%--linha--%>
                            <div style="float:left; margin-left:5px; width:11%; margin-top:8px;">
                                <asp:Label ID="lbl_tur_dtcriacao" runat="server" Text="Data criação" 
                                    Font-Bold="True" Font-Size="X-Small"></asp:Label>        
                                <telerik:RadDateInput ID="tur_dtcriacao" runat="server" Font-Size="X-Small" 
                                    Width="97%" AutoPostBack="True" ontextchanged="tur_dtcriacao_TextChanged" 
                                    TabIndex="8">
                                    <ReadOnlyStyle BackColor="#D6DCDB" />
                                </telerik:RadDateInput>
                            </div>  
                            <div style="float:left; margin-left:10px; width:11%; margin-top:8px;">
                                <asp:Label ID="lbl_tur_dtformacao" runat="server" Text="Data formação" 
                                    Font-Bold="True" Font-Size="X-Small"></asp:Label>        
                                <telerik:RadDateInput ID="tur_dtformacao" runat="server" Font-Size="X-Small" 
                                    Width="97%" TabIndex="9">
                                    <ReadOnlyStyle BackColor="#D6DCDB" />
                                </telerik:RadDateInput>
                            </div> 
                            <div style="float:left; margin-left:10px; width:11%; margin-top:8px;">
                                <asp:Label ID="lbl_tur_dtfechamento" runat="server" Text="Data fechamento" 
                                    Font-Bold="True" Font-Size="X-Small"></asp:Label>        
                                <telerik:RadDateInput ID="tur_dtfechamento" runat="server" Font-Size="X-Small" 
                                    Width="97%" TabIndex="10">
                                    <ReadOnlyStyle BackColor="#D6DCDB" />
                                </telerik:RadDateInput>
                            </div> 
                            <div style="float:left; margin-left:10px; width:11%; margin-top:8px;">
                                <asp:Label ID="lbl_tur_qtmensalidades" runat="server" Text="Total mensalidades" 
                                    Font-Bold="True" Font-Size="X-Small"></asp:Label>        
                                <telerik:RadNumericTextBox ID="tur_qtmensalidades" runat="server" Font-Size="X-Small"
                                            Width="97%" DataType="System.Int32" ReadOnly="false" TabIndex="11">
                                            <NumberFormat DecimalDigits="0" />
                                            <ReadOnlyStyle BackColor="#CCCCCC" />
                                </telerik:RadNumericTextBox>
                            </div>
                            <div style="float:left; margin-left:10px; width:11%; margin-top:0px;">
                                <asp:Label ID="lbl_tur_valorreferencia" runat="server" Text="Mensalidade" 
                                    Font-Bold="True" Font-Size="X-Small"></asp:Label>        
                                <asp:RequiredFieldValidator ID="rfv_tur_valorreferencia" runat="server" ControlToValidate="tur_valorreferencia"
                                        ErrorMessage=" (*)" ForeColor="Red" ValidationGroup="camposObrigatorios"></asp:RequiredFieldValidator>
                                <telerik:RadNumericTextBox ID="tur_valorreferencia" runat="server" Font-Size="X-Small"
                                            Width="97%" Culture="pt-BR" TabIndex="12">
                                            <NumberFormat DecimalDigits="2" />
                                            <ReadOnlyStyle BackColor="#CCCCCC" />
                                </telerik:RadNumericTextBox>
                            </div>
                            <div style="float:left; margin-left:10px; width:6%; margin-top:8px;">
                                <asp:Label ID="lbl_tur_stexcluido" runat="server" Text="Inativo" Font-Bold="true" 
                                    Font-Size="X-Small"></asp:Label> <br />
                                <asp:CheckBox ID="tur_stexcluido" runat="server" TabIndex="13" />
                            </div> 
                            
                            <div style="float:right; margin-right:5px; width:30%; ">
                                <asp:Label ID="lbl_usuario_id" runat="server" Text="Professor" 
                                    Font-Bold="True" Font-Size="X-Small"></asp:Label>                                        
                                <telerik:RadComboBox ID="usuario_id" runat="server" 
                                                            Font-Size="X-Small" Width="100%" DataTextField="USU_NOME" 
                                                            DataValueField="USUARIO_ID" Filter="Contains" 
                                                            EmptyMessage="Selecione" MarkFirstMatch="True" 
                                                            EnableLoadOnDemand="True" onitemsrequested="usuario_id_ItemsRequested" 
                                                            style="margin-bottom: 0px" TabIndex="14">                        
                                            </telerik:RadComboBox>
                            </div>
                                                                                           
                            <%--linha--%>                                                       
                            <div style="float:left; margin-left:5px; width:99%; margin-top:5px;">
                                <asp:Label ID="lbl_mtr_observacao" runat="server" Text="Observações gerais sobre o material" 
                                    Font-Bold="True" Font-Size="X-Small"></asp:Label>
                                <telerik:RadTextBox ID="mtr_observacao" Runat="server" Font-Size="X-Small" 
                                    Width="97%" 
                                    ReadOnly="false" TextMode="MultiLine" Rows="3" TabIndex="15">
                                    <ReadOnlyStyle BackColor="#D6DCDB" />
                                </telerik:RadTextBox>
                            </div>
                            
                </td>
            </tr>
            <tr>
                <td align="right">
                    <div style="float: right; margin-right: 0px; margin-top: 5px;">
                        <asp:ImageButton ID="imgbCancelar" runat="server" ImageUrl="~/Imagens/botoes_pagina_retornar.png"
                            OnClientClick="Close(); return false;" TabIndex="17" />
                    </div>
                    <div style="float: right; margin-right: 5px; margin-top: 5px;">
                        <asp:ImageButton ID="imgbConfirmarDadosCad" runat="server" ImageUrl="~/Imagens/botoes_confirmar.png"
                            OnClick="imgbConfirmarDadosCad_Click" 
                            ValidationGroup="camposObrigatorios" TabIndex="16" />
                    </div>
                    <div style="float: right; margin-top: 5px; margin-right: 5px;">
                        <asp:ImageButton ID="imgb_dicaPagina" runat="server" ImageUrl="~/Imagens/botoes_pagina_dica_paginar.png"
                            OnClientClick="alert('Utilize esta página para cadastrar itens utilizado pelos Alunos. \n Materiais como CD's, DVD's, livros e albuns de fotos são exemplos de materias a serem cadastrados.')"
                            Style="cursor: help" ToolTip="Dica de Página!" TabIndex="18" />
                    </div>
                </td>
            </tr>
        </table>
            
    </div>
    </form>
</body>
</html>
